package com.example.tms.mapper;


import com.example.tms.bean.CarInfo;
import com.example.tms.bean.RepairProject;
import com.example.tms.bean.RepairView;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RepairProjectMapper extends JpaRepository<RepairProject,String>, JpaSpecificationExecutor<RepairProject> {

    List<RepairProject> findByRepairIdAndSfcz(String repairId, boolean sfcz);
    List<RepairProject> findByRepairProjectNameAndSfcz(String repairProjectName, boolean sfcz);

    @Query(value = "select * from repairproject_info where sfqt = ?1 and sfcz = true", nativeQuery = true)
    List<RepairProject> findBySfqt(Boolean sfqt);

    @Query(value = "select * from repairproject_info where repairid = ?1 and repairprojectname = ?2 and sfcz = true", nativeQuery = true)
    RepairProject findByrepairProjectNameAndRepairId(String repairId,String repairProjectName);
}
